
import java.util.*;

public class dcount {

    public static long dcount(Graph g) {

        return run(g, new LinkedList(), 0) + 1;
    }

    private static long run(Graph g, LinkedList<Edge> set, int i) {
        if (i >= g.edges.size()) {
            return 0;
        }



        if (isMatch(set,g.edges.get(i))) {
            long removed = run(g, set, i + 1);
		set.add(g.edges.get(i));
            long added = run(g, set, i + 1);
set.remove(g.edges.get(i));
            return added + removed + 1;
        } else {
            return run(g, set, i + 1);
        }
    /*
        set.add(g.edges.get(i));
        if (g.isMatching(set)) {
            long added = run(g, set, i + 1);
            set.removeLast();
            long removed = run(g, set, i + 1);
            return added + removed + 1;
        } else {
            set.removeLast();
            return run(g, set, i + 1);
        }*/
    }

private static boolean isMatch(LinkedList<Edge> match, Edge newEdge){
for (Edge e:match)
if (e.from==newEdge.from||e.to==newEdge.to||e.from==newEdge.to||e.to==newEdge.from)
return false;
return true;
}
}
